function bubbleSort()

{

declare -a lsts=$1



len=`expr ${#lst[*]} - 1`

for i in `seq  0 ${len}`

do

jtmp=$((${len} - ${i} -1))

for j in `seq 0 ${jtmp} `

do

if (( ${lst[j]} > ${lst[j+1]} ));then

tmp=${lst[j]}

lst[j]=${lst[j+1]}

lst[j+1]=${tmp}

fi

done

done

echo "sorted list is :${lst[*]}"

}

lst=(1 9 19 55 0 33 54 36)

bubbleSort  "${lst[*]}"
